import request from '@/utils/request'

// 查询新品上线配置列表
export function listNewarrival(query) {
  return request({
    url: '/system/newarrival/list',
    method: 'get',
    params: query
  })
}

// 查询新品上线配置详细
export function getNewarrival(newarrivalId) {
  return request({
    url: '/system/newarrival/' + newarrivalId,
    method: 'get'
  })
}

// 新增新品上线配置
export function addNewarrival(data) {
  return request({
    url: '/system/newarrival',
    method: 'post',
    data: data
  })
}

// 修改新品上线配置
export function updateNewarrival(data) {
  return request({
    url: '/system/newarrival',
    method: 'put',
    data: data
  })
}

// 删除新品上线配置
export function delNewarrival(newarrivalId) {
  return request({
    url: '/system/newarrival/' + newarrivalId,
    method: 'delete'
  })
}

export function listProducts() {
  return request({
    url: '/system/newarrival/products',
    method: 'get'
  })
}
